<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <hello-world age='25'></hello-world>
        <hello-world :age='age'></hello-world>
    </div>
    <script src="../vue.js"></script>
    <script>
        // 子组件的子组件
        Vue.component('hello-third', {
                props: ['myName'],
                template: `
                    <div>
                        <p>{{myName}}</p>
                    </div>
                `
            })
            // 子组件
        Vue.component('hello-world', {
            props: ['age'],
            data: function() {
                return {
                    name: 'Tom'
                }
            },
            template: `
            <div>
                <p>{{ name + "------" + age}}</p>  
                <hello-third myName="Jerry"></hello-third>  
                </div>
            `

        })
        var vm = new Vue({
            el: '#app',
            data: {
                age: 10
            }
        })
    </script>
</body>

</html>